import { axios } from '@/utils/request'

export function sysOperateUserList(params) {
  return axios({
    url: '/sys/user/pageListUser',
    method: 'get',
    params
  })
}
export function sysAddOperateUser(parameter) {
  return axios({
    url: '/sys/user/addUser',
    method: 'post',
    data: parameter
  })
}
export function sysEditOperateUser(parameter) {
  return axios({
    url: '/sys/user/updateUser',
    method: 'post',
    data: parameter
  })
}
export function sysEditOperatePwdUser(parameter) {
  return axios({
    url: '/sys/user/updatePassword',
    method: 'post',
    data: parameter
  })
}
export function sysOperateDelUser(id) {
  id = id === undefined ? '' : id;
  return axios({
     url:`/sys/user/delete?id=${id}`,
    method: 'get',
  })
}
export function sysOperateEnableUser(status,id) {
  status = status === undefined ? '' : status;
  id = id === undefined ? '' : id;
  return axios({
     url:`/sys/user/disOrEnableUser?id=${id}&status=${status}`,
    method: 'get',
  })
}
export function sysResetPasswordOperateUser(parameter) {
  return axios({
    url: '/sys/user/resetPassword',
    method: 'post',
    data: parameter
  })
}
export function sysDistributeOperateUserRole(parameter) {
  return axios({
    url: '/sys/user/applyRoleToUser',
    method: 'post',
    data: parameter
  })
}
export function sysGetOperateEnableToIsDelUser(relationId) {
  return axios({
    url:`/sys/user/listAllEnabledAdminUser?relationId=${relationId}`,
    method: 'get'
  })
}

// 用户共享
export function postUserShare(parameter) {
  return axios({
    url: '/sys/user/share',
    method: 'post',
    data: parameter
  })
}
// 取消用户共享
export function postUserDeleteShare(parameter) {
  return axios({
    url: '/sys/user/deleteShare',
    method: 'post',
    data: parameter
  })
}
// 用户共享列表
export function getUserShareList() {
  return axios({
    url: '/sys/user/shareUsers',
    method: 'get'
  })
}

